<?php
class ZendX_WebConfig{
	
	protected $_options;
	protected $_xmlfile;
	
	public function __construct($xmlfile=""){
		if($xmlfile==""){
			$xmlfile = APPLICATION_PATH."/configs/webconfig.xml";
		}
		$this->_xmlfile = $xmlfile;		
		$config = new Zend_Config_Xml($xmlfile, NULL, array('skipExtends'=> true,'allowModifications' => true));
		$this->_options = $config;
	}
	
	public function getOption($key){
		if(property_exists($this->_options, $key)){
			return $this->_options->{$key};
		}
		return NULL;
	}
	
	public function setOption($key,$value){
		if(property_exists($this->_options, $key)){
			$this->_options->{$key} = $value;
			$writer = new Zend_Config_Writer_Xml(array('config'=>$this->_options,'filename'=>$this->_xmlfile));
			return true;
		}
		return false;
	}	
}
?>